﻿using System.Collections;

namespace GianosNET.Common.ServerUtils
{
    public class CustomDataSource
    {
        private static Hashtable userInformation = new Hashtable();

        public static void AddUserData(string token, string userId)
        {
            userInformation[token] = userId;
        }

        public static string GetUserData(string token)
        {
            return userInformation[token] == null ? "" : (string)userInformation[token];
        }

        public static bool IsValidToken(string token)
        {
            if (string.IsNullOrEmpty(token))
            {
                return false;
            }

            return userInformation[token] == null ? false : true;
        }
    }
}